#define _CRT_SECURE_NO_WARNINGS 1
#include<iostream>
#include<cmath>
using namespace std;


int main()
{
	int n;
	double a, b;
	int p;
	double t;
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> a >> b >> p;
		t += sqrt(a * a + b * b) * 2 / 50 + 1.5 * p;
	}
	cout << (int)ceil(t) << endl;
	return 0;
}
